package cn.wusifx.zabbix.request.builder.template;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.UpdateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/template/update
 */
public class TemplateUpdateRequestBuilder extends UpdateRequestBuilder {
    private String templateId;
    public TemplateUpdateRequestBuilder(String auth) {
        super("template.update", auth);
    }

    public TemplateUpdateRequestBuilder(Long id, String auth) {
        super("template.update", id, auth);
    }

    public String getTemplateId() {
        return templateId;
    }

    public TemplateUpdateRequestBuilder setTemplateId(String templateId) {
        this.templateId = templateId;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("templateid",templateId);
        return baseRequest;
    }
}
